package com.example.demo.service;

import com.example.demo.mapper.UserMapper;
import com.example.demo.model.UserInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {
    @Resource
    private UserMapper userMapper;

    public UserInfo login(UserInfo userInfo) {
        return userMapper.login(userInfo);
    }

    public int register(UserInfo userInfo) {
        return userMapper.register(userInfo);
    }

    public UserInfo getUserByName(String username) {
        return userMapper.getUserByName(username);
    }

    public UserInfo getUserById(Integer id) {
        return userMapper.getUserById(id);
    }

}
